<!DOCTYPE html>
<!--
*
* Copyright (C) 2015, bitmovin GmbH, All Rights Reserved
*
* Created on: 2015-06-12 14:00:00
* Author:     bitmovin GmbH <dash-player@bitmovin.net>
*
* This source code and its use and distribution, is subject to the terms
* and conditions of the applicable license agreement.
*
-->
<html lang="en">
<head>
  <title>libdash SDK</title>
  <meta charset="UTF-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" type="text/css" href="../style/demo.css"/>
  <link rel="stylesheet" type="text/css" href="../style/style.css"/>
  <link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'/>
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>

  <script type="text/javascript" src="libdash/settings.js"></script>

  <!-- player -->
  <script type="text/javascript" src="https://bitmovin-a.akamaihd.net/bitdash/latest/bitdash.min.js"></script>
</head>
<body>
<a href="index.html"><button id="back-button">Back to the Menu</button></a>
<div class="container">
  <h1>A simple configuration <span>Getting Startedd</span></h1>

  <div class="content">
    <div class="player-wrapper">
      <div id="player"></div>
    </div>
    <div class="description">
      <h2 class="ca-main">Getting Started with the Most Simple Configuration</h2>
      <pre><code class="language-javascript">
        &lt;script src="<span id="cdnPath"></span>"&gt;
        &lt;/script&gt;
      </code></pre>
      <p>And tell the player what to do, using a config object, which might look as follows:</p>
      <pre><code class="language-javascript">
        var config = {
          key :  '<span id="playerKey"></span>',
          source: {
            dash: 'https://bitdash-a.akamaihd.net/.../f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd'
          }
        }</code></pre>
      <p>All entries within the config object are case sensitive. The config object can have further (optional) properties. While key is a string, all others are objects.
        The next step is to add and setup a player. Just pass the unique id of an HTML container element (like div):</p>
      <pre><code class="language-javascript">
        var player = bitdash('player');
        player.setup(conf);
      </code></pre>
      <p>It's as simple as that! For more information about the player configuration, please have a look at the <a href="http://developer.dash-player.com/player-configuration" target="_blank">related document</a>.</p>
    </div>
  </div>

</div>
<script type="text/javascript" src="js/ErrorMsgHelper.js"></script>
<script type="text/javascript">
  (function() {
    document.getElementById('playerKey').innerHTML = window.libdashSettings.credentials.key;
    document.getElementById('cdnPath').innerHTML = window.libdashSettings.cdnPath;
    var createPlayer = function () {

      var conf = {
        key: window.libdashSettings.credentials.key,
        source: {
          dash: 'https://bitdash-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd'
        },
        style: {
          width: '50vw',
          aspectratio: '16/9'
        }
      };

      var player = bitdash('player');
      player.setup(conf);
    };
    createPlayer();
  }());
</script>
</body>
</html>
